<template>
  <div>
    <!-- 个人用户信息 -->
    <personInfo v-if="userFlag" :userInfo="newUserInfo" :isChecking="isCheck" @showComDialog="showDialog"></personInfo>
    <!--  所有弹框  -->
    <modifyAllDialog  v-if="userFlag&&isShowPop"  :visible.sync="isShowPop" :userInfo="newUserInfo" :userTitle="currentTitle" :userWidth="currentWidth" @initData="initUserInfo()"></modifyAllDialog>
    <cancelFooter v-if="userFlag"></cancelFooter>
  </div>
</template>

<script>
// import { deepClone } from '@/utils/utils'
import personInfo from './personInfo'
import modifyAllDialog from './modifyAllDialog'
import cancelFooter from './cancelFooter'
import '@/style/userInfo.less'
export default {
  components: {
    personInfo,
    modifyAllDialog,
    cancelFooter
  },
  data () {
    return {
      currentTitle: '',
      currentWidth: '',
      userFlag: true,
      isShowPop: false,
      newUserInfo: {
      },
      isCheck: false
    }
  },
  async created () {
    this.initUserInfo()
    this.newUserInfo = JSON.parse(localStorage.getItem('addUser'))
  },
  watch: {
  },
  methods: {
    showDialog (val) {
      this.isShowPop = true
      this.currentTitle = ''
      this.currentWidth = '760px'
      if (val === '个人基本信息修改') {
        this.currentWidth = '800px'
        this.currentTitle = '个人基本信息修改'
      }
    },
    initUserInfo () {
      this.userFlag = true
      let userState = localStorage.getItem('userState')
      if (userState === '00') {
        this.isCheck = false
      } else {
        this.isCheck = true
      }
    }
  }
}
</script>

<style lang="less" scoped>
</style>
